package com.itheima.array;

public class Test02 {
    public static void main(String[] args) {
        /*
        数组求和
         */
        int[] arr = {1, 3, 5, 6, 999, 997, 995, 994};
        //定义一个变量,值为零
        int sum = 0;
        //遍历数组
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println(sum);


    }
}
